<?PHP
  class PluginPage extends Editor{
    function __construct($page){
      $this->page = $page;
    }
  
    public function display(){
      $template = new Template();
      $template->load("plugins");
      $plugins = new PluginList();
      $plugins->loadAll();
      $myurl = Settings::getInstance()->get("host").$_GET['include'].".html";
      foreach($plugins->plugins as $plugin){
        $index = $template->add_loop_item("PLUGINS");
        if(isset($_GET['activate']) && $_GET['activate'] == $plugin->path){
          $plugin->activate();
        }
        elseif(isset($_GET['deactivate']) && $_GET['deactivate'] == $plugin->path){
          $plugin->deactivate();
        }
        $template->assign_loop_var("PLUGINS",$index,"NAME",htmlentities($plugin->name));
        $template->assign_loop_var("PLUGINS",$index,"DESCRIPTION",htmlentities($plugin->description));
        $template->assign_loop_var("PLUGINS",$index,"VERSION",$plugin->version);
        $template->assign_loop_var("PLUGINS",$index,"AUTHORLINK",$plugin->authorLink);
        $template->assign_loop_var("PLUGINS",$index,"AUTHORNAME",htmlentities($plugin->authorName));
        if($plugin->isActivated()){
          $template->assign_loop_var("PLUGINS",$index,"ACTIVATIONLINK","<a href=\"".$myurl."?deactivate=".urlencode($plugin->path)."\">Deaktvieren</a>");
        }
        else{
          $template->assign_loop_var("PLUGINS",$index,"ACTIVATIONLINK","<a href=\"".$myurl."?activate=".urlencode($plugin->path)."\">Aktvieren</a>");
        }
      }
      $template->output();
    }
    
    function getHeader(){
    }
    
    public function getEditableCode(){
      return "<input name=\"save\" type=\"submit\" value=\"&Auml;ndern\" onclick=\"form.action='".$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']."' ; target='_self' ; return true\" />";
    }
    
    public function save($newPage,$oldPage){
    }    
}
?>